{extend name="public:head"}
{block name="main"}

<form class="layui-form" style="margin: 20px">
    <div class="demoTable">
        条件搜索：
        <div class="layui-inline">
            <select name="status">
                <option value="">全部状态</option>
                <option value="1">正常</option>
                <option value="0">禁用</option>
            </select>
        </div>
        <div class="layui-inline">
            <input class="layui-input" name="company_name"  autocomplete="off" placeholder="公司名称">
        </div>
        <div class="layui-inline">
            <button class="layui-btn" lay-filter="submit" lay-submit>搜索</button>
            <button class="layui-btn layui-btn-primary"  lay-filter="submit" lay-submit>重置</button>
        </div>

    </div>
</form>

<table class="layui-hide" id="all" lay-filter="all" lay-data="{id: 'sousuo'}"></table>


<script>
    layui.use(['table','layer','form'], function(){
        var table = layui.table;
        var layer = layui.layer;
        var form = layui.form;
        table.render({
            elem: '#all'
            ,url:'/admin/Record/allRecord'
            ,toolbar: '#toolbarDemo'
            ,cols: [[
                {type: 'checkbox', fixed: 'left'}
                ,{field:'id', title:'ID',  fixed: 'left', unresize: true, sort: true}
                ,{field:'from', title:'推广公司'}
                ,{field:'phone_num', title:'注册手机'}
                ,{field:'ip', title:'注册IP'}
                ,{field:'address', title:'注册地址'}
                ,{field:'count', title:'登陆次数'}
                ,{field:'add_time', title:'添加时间'}
            ]]
            ,page: true
        });
        // 表格重载 用于搜索
        form.on('submit(submit)', function(data){
            var field=data.field;
            if($(data.elem).html()=="重置"){
                $("input").val("");
                field="";
            }
            table.reload('all', {
                url: '/admin/Popularize/findAccount?XDEBUG_SESSION_START=19326',
                where: {field}
            });
            return false;
        });
    });
</script>


{/block}